//
//  WJQHeadScrollCollectionViewCell.m
//  TripTogether
//
//  Created by dllo on 15/12/29.
//  Copyright © 2015年 王军岐. All rights reserved.
//

#import "WJQHeadScrollCollectionViewCell.h"
#import "CycleScrollView.h"

@interface WJQHeadScrollCollectionViewCell ()

@property (nonatomic, strong) CycleScrollView *cycleView;

@end

@implementation WJQHeadScrollCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}
- (void)createSubView
{
    _cycleView = [[CycleScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200)];
    [self.contentView addSubview:_cycleView];
}

- (void)setArray:(NSMutableArray *)array
{
    for (UIView *view in [_cycleView subviews]) {
        
        [view removeFromSuperview];
    }
    if (array.count != 0) {
        
        [_cycleView createCycleScrollViews:[array mutableCopy]];
    }

}

@end
